<template>
  <div class="home">
       <div class="box">123</div>
       <button @click="num++">num++</button>
       <h1>{{num}}</h1>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'HomeView',
  data() {
    return {
        num:10
    }
  },
  components: {
    HelloWorld
  },
  beforeCreate() {
     console.log('创建实例之前')
  },
  created() {
    console.log('创建实例之后')
    // this.$nextTick(()=>{
    //      let dom = document.querySelector('.box')
    // console.log(dom);
    // });
    setTimeout(()=>{
    let dom = document.querySelector('.box')
    console.log(dom);
    },0)
  },
  mounted() {
    let dom = document.querySelector('.box')
    console.log(dom);
  },
  destroyed(){
    console.log('home页面销毁了');
  }
}
</script>
